const ws = require("nodejs-websocket");
const parseJs = require("./rule/cyhook");

var cbb_server = ws.createServer(conn => {
    conn.on("text", function (str) {
        try {
            var text = parseJs(str);
            console.log("替换一次")
        } catch (e) {
            var text = str;
        }
        ;
        conn.send(text);
    });

    conn.on("close", function () {
        console.log('链接断开了')
    });

    conn.on("error", function (err) {
        console.log(err, "连接报错");
    });
});
const port = 418;
cbb_server.listen(port, function () {

    console.log("开启成功")
})
